<template>
  <div v-loading="loading" />
</template>
<script>
import { getPortals, getInfoByToken } from './api.js'
export default {
  name: 'Internal',
  data() {
    return {
      loading: true,
      access_token: ''
    }
  },
  async created() {
    if (this.$route.query.token) {
      this.access_token = this.$route.query.token
      this.$storage.set('access_token', this.access_token)
      await getInfoByToken(this.access_token).then((res) => {
        this.$storage.set('username', res.userName)
      })
      this.redirectTo()
    }
  }
}
</script>
<style lang="scss" scoped>
</style>